<?php
require_once('Writer.php');
$workbook = new Spreadsheet_Excel_Writer();
		$workbook->setVersion(8, 'utf-8');
        $worksheet = $workbook->addWorksheet('Đối Soát');
        $worksheet->setInputEncoding('UTF-8');
        $header = &$workbook->addFormat();
        $header->setBold();
        $header->setHAlign('center');
        $header->setBorder(0);
        $header->setTextWrap ();
        $header->setvAlign('vcenter');     
        $header->setFontFamily('Times New Roman');
        $header->setSize(11);
        $worksheet->setRow (0,20);
        $line2 = $workbook->addFormat();
        $line2->setHAlign('center');
        $line2->setBorder(0);
        
  		$worksheet->setColumn(0,0,7);
  		$worksheet->setColumn(1,1,10); 
  		$worksheet->setColumn(2,2,14);
  		$worksheet->setColumn(3,3,16);
  		$worksheet->setColumn(4,4,14);
  		$worksheet->setColumn(5,5,12);
  		$worksheet->setColumn(6,6,14);
  		$worksheet->setColumn(7,7,13); 
  		$worksheet->setColumn(8,8,25);     
  		$worksheet->setColumn(9,9,15);         
  		
        $worksheet->setZoom(100);
          
        $str = 'Tháng 3 năm 2012';
        $worksheet->write(0, 0, 'Bảng Đối Soát Thẻ Rev', $header);
        $worksheet->mergeCells(0,0,0,9);
        $worksheet->write(1,0,$str,$line2);
        $worksheet->mergeCells(1,0,1,9);
        $worksheet->write(5, 0, 'STT', $header);               
        $worksheet->write(5, 1, 'Mã hóa đơn', $header);        
        $worksheet->write(5, 2, 'Mã thẻ', $header);             
        $worksheet->write(5, 3, 'Mã giao dịch', $header);
        $worksheet->write(5, 4, 'Số tiền', $header);  
        $worksheet->write(5, 5, 'Phí dịch vụ', $header);  
        $worksheet->write(5, 6, 'Tổng tiền thanh toán', $header);  
        $worksheet->write(5, 7, 'Phí phát hành Rev hưởng', $header);  
        $worksheet->write(5, 8, 'Trạng thái', $header);  
        $worksheet->write(5, 9, 'Ngày tạo', $header);  
//kết thúc


//gửi header để lưu file
$workbook->send('test.xls');
$workbook->close();
?>
